﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace iBet
{
    /// <summary>
    /// Ticket class
    /// </summary>
    [Serializable]
    [DataContract(Name="Ticket")]
    public class Ticket
    {
        /// <summary>
        /// Bet for the ticket
        /// </summary>
        [DataMember(Name="Bet")]
        public double Bet { get; set; }

        /// <summary>
        /// List of ticket items
        /// </summary>
        [DataMember(Name="Items")]
        public List<TicketItem> Items { get; set; }

    }

    /// <summary>
    /// Ticket item class
    /// </summary>
    [Serializable]
    [DataContract(Name="TicketItem")]
    public class TicketItem
    {
        /// <summary>
        /// Type of system played for current ticket item
        /// <example>3/5</example>
        /// </summary>
        [DataMember(Name="SystemType")]
        public SystemType SystemType { get; set; }

        /// <summary>
        /// List of odds (quotas)
        /// </summary>
        [DataMember(Name="Odds")]
        public List<Odd> Odds { get; set; }
    }

    /// <summary>
    /// Odd class 
    /// This class holds the value for the odd
    /// and the mark if the odd is hit
    /// </summary>
    [Serializable]
    [DataContract(Name="Odd")]
    public class Odd
    {
        /// <summary>
        /// Value of the odd
        /// </summary>
        [DataMember(Name="Value")]
        public double Value { get; set; }

        /// <summary>
        /// Mark if the odd has been hit
        /// </summary>
        [DataMember(Name="IsHit")]
        public bool IsHit { get; set; }
    }

    /// <summary>
    /// SystemType class
    /// This class holds the system played
    /// for each ticket item
    /// <example>3/5</example>
    /// </summary>
    [Serializable]
    [DataContract]
    public class SystemType
    {
        /// <summary>
        /// Min value for the system type
        /// NOTE: Min should less than or equal from Max
        /// </summary>
        [DataMember(Name="Min")]
        public int Min { get; set; }

        /// <summary>
        /// Max value for the system type
        /// NOTE: Max should be greater than or equal from Min
        /// </summary>
        [DataMember(Name="Max")]
        public int Max { get; set; }
    }
}
